import request from '@/utils/request'

// 查询ukey列表数据
export function ukeyList(data) {
  return request({
    url: '/basic/ukey/findList',
    method: 'post',
    data
  })
}

// 获取启动页URL
export function startUrl(params) {
  return request({
    url: '/basic/ukey/startUrl',
    method: 'get',
    params
  })
}

// 绑定Ukey
/**
 * 
     * 芯片ID  chipId;
     * 写入加密后字符串  encryptionStr;
     * 拓展版本  expandVersion;
     * 密码  passWord;
     * 读密码  readPassword;
     * (增强)密钥一  secretKeyOne;
     * (增强)密钥二  secretKeyTwo;
     * 启动URl  startUrl;
     * 状态（0正常 1停用）  state;
     * 锁id  ukeyId;
     * 用户ID  userId;
     * 锁的版本  version;
     * 写密码  writePassword;
 * @param {*} data 
 * @returns 
 */
export function saveUkey(data) {
  return request({
    url: '/basic/ukey/saveUkey',
    method: 'post',
    data
  })
}

// 获取列表详情
export function getUkeyInfo(id) {
  return request({
    url: '/basic/ukey/getInfo/' + id,
    method: 'get'
  })
}

// 删除ukey
export function removeUkey(id) {
  return request({
    url: '/basic/ukey/removeUkey/' + id,
    method: 'get'
  })
}

// 改变状态
export function operateState(id, state) {
  return request({
    url: `/basic/ukey/operateState/${id}/${state}`,
    method: 'get'
  })
}

